package com.ayun.bean;

import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import java.sql.Date;

public class User {
    @NotNull
    @Length(min = 1,max = 20)
    private String username;
    @NotNull
    @Length(min = 1,max = 20)
    private String name;
    @NotNull
    @Past
    private Date birth;
    @NotNull
    @Length(min = 11,max = 11)
    private String phoneNumber;
    @NotNull
    private String address;
    @NotNull
    private String vocation;
    private String medicalHistory;
    private String drugAllergy;
    private boolean sex;

    private String dateStr;

    public User() {
    }

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", name='" + name + '\'' +
                ", birth=" + birth +
                ", phoneNumber='" + phoneNumber + '\'' +
                ", address='" + address + '\'' +
                ", vocation='" + vocation + '\'' +
                ", medicalHistory='" + medicalHistory + '\'' +
                ", drugAllergy='" + drugAllergy + '\'' +
                ", sex=" + sex +
                '}';
    }

    public User(@NotNull @Length(min = 1, max = 20) String username, @NotNull @Length(min = 1, max = 20) String name, @NotNull @Past Date birth, @NotNull @Length(min = 11, max = 11) String phoneNumber, @NotNull String address, @NotNull String vocation, String medicalHistory, String drugAllergy, boolean sex) {
        this.username = username;
        this.name = name;
        this.birth = birth;
        this.phoneNumber = phoneNumber;
        this.address = address;
        this.vocation = vocation;
        this.medicalHistory = medicalHistory;
        this.drugAllergy = drugAllergy;
        this.sex = sex;
    }

    public String getDateStr() {
        return dateStr;
    }

    public void setDateStr(String dateStr) {
        this.dateStr = dateStr;
    }

    public boolean isSex() {
        return sex;
    }

    public void setSex(boolean sex) {
        this.sex = sex;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getBirth() {
        return birth;
    }

    public void setBirth(Date birth) {
        this.birth = birth;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getVocation() {
        return vocation;
    }

    public void setVocation(String vocation) {
        this.vocation = vocation;
    }

    public String getMedicalHistory() {
        return medicalHistory;
    }

    public void setMedicalHistory(String medicalHistory) {
        this.medicalHistory = medicalHistory;
    }

    public String getDrugAllergy() {
        return drugAllergy;
    }

    public void setDrugAllergy(String drugAllergy) {
        this.drugAllergy = drugAllergy;
    }
}
